﻿<?php
//	Checks if this file is called within the framework; otherwise terminates.
if (!defined("IS_FRAMEWORK") || !IS_FRAMEWORK)	header("Location: http://".$_SERVER["HTTP_HOST"]."/error/404");
?>
<div class="component">
	<h1><?php echo $controls["title"]; ?></h1>
	<!-- List of contents -->
	<table>
		<tr>
			<th>No.</th>
			<th>Title</th>
			<th>Date</th>
		</tr>
<?php if (!empty($controls["contents"]) && count($controls["contents"]) > 0) { ?>
<?php	foreach ($controls["contents"] as $content) { ?>
		<tr>
			<td><?php echo $content["contentID"]; ?></td>
			<td><a href="<?php echo $content["uri"]; ?>"><?php echo $content["title"]; ?></a></td>
			<td><?php echo $content["dateCreated"]; ?></td>
		</tr>
<?php	} ?>
<?php } else { ?>
		<tr>
			<td colspan="3">No content</td>
		</tr>
<?php } ?>
	</table>
</div>
